let http = require('http');
let fs = require('fs');
let server = http.createServer();

let Browser = require('child_process')
const PORT = 3000;

server.on(
    'request', (req, res) => {
        let html = fs.readFileSync('./index.html', 'utf-8');
        html.split(/\r?\n/).forEach(
            (line) => (console.log(line))
        )
        res.end();
    }
);

server.listen(PORT);
Browser.exec("start http://127.0.0.1:" + PORT);